﻿using Prism.Commands;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfApp_PrismRegionBase.ViewModels.Pages;

public class DialogUserViewModel : IDialogAware
{
    public string Title => "我是弹出子窗口";

    public event Action<IDialogResult>? RequestClose;

    public DelegateCommand? LoadSubWindowRegion { get; set; }

    public DialogUserViewModel(IRegionManager regionManager)
    {
        LoadSubWindowRegion = new DelegateCommand(() => 
        {
            regionManager.RequestNavigate("subViewRegion", "SubDialogView");
        });
    }

    public bool CanCloseDialog()
    {
        return true;
    }

    public void OnDialogClosed()
    {
        
    }

    public void OnDialogOpened(IDialogParameters parameters)
    {
        
    }
}
